Skip to content

Minor changes required for nnet3 sequence training#560

Merged
danpovey merged 1 commit intokaldi-asr:chainfrom
vimalmanohar:sequence_changes
Mar 7, 2016
Merged

Minor changes required for nnet3 sequence training#560
danpovey merged 1 commit intokaldi-asr:chainfrom
vimalmanohar:sequence_changes

Conversation

@vimalmanohar
Copy link
Contributor

No description provided.

@danpovey
Copy link
Contributor

danpovey commented Mar 6, 2016

Thanks- will try to review soon. @vijayaditya, if you have time please take a look.

@vijayaditya
Copy link
Contributor

OK, I will work on this after the ivector PR from Yiming.

--VIjay

On Sat, Mar 5, 2016 at 9:45 PM, Daniel Povey notifications@github.com
wrote:

Thanks- will try to review soon. @vijayaditya
https://github.com/vijayaditya, if you have time please take a look.


Reply to this email directly or view it on GitHub
#560 (comment).

@vimalmanohar
Copy link
Contributor Author

Note: This is not the full set of changes. There is a lot of codes and scripts, which is beyond what the github diff allows to view. So I am committing them in small chunks that would be easier to look at. This is first set of commits.

@vimalmanohar
Copy link
Contributor Author

I can push the next set of commits once this is merged.

// negated costs. Requires that lat be topologically sorted. This code
// will work for either CompactLattice or Latice.
template<typename LatticeType>
double ComputeLatticeAlphasAndBetas(const LatticeType &lat,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vimal, it's not good for compilation speed to define this in the header.
Just declare it in the header, and in the .cc file, define it and instantiate it for float and double.

@danpovey
Copy link
Contributor

danpovey commented Mar 7, 2016

OK, done. Please merge or rebase.

@vimalmanohar vimalmanohar force-pushed the sequence_changes branch 2 times, most recently from cb187d9 to 541e4ae Compare March 7, 2016 00:20
@vimalmanohar
Copy link
Contributor Author

I have changed the functions to use SetUnderlyingLearningRate

if (uc == NULL)
KALDI_ERR << "Updatable component does not inherit from class "
"UpdatableComponent; change this code.";
uc->SetUnderlyingLearningRate(uc->LearningRate() * learning_rate_scale);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you actually want to use SetActualLearningRate() here.

@vimalmanohar
Copy link
Contributor Author

I made the change.

vector<double> *beta);


static inline double LogAddOrMax(bool viterbi, double a, double b) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you still need this function to be in the header?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a small function that can be inlined. If it is moved to .cc file, it
cannot be inlined.

On Sun, Mar 6, 2016 at 8:19 PM Daniel Povey notifications@github.com
wrote:

In src/lat/lattice-functions.h
#560 (comment):

@@ -74,6 +74,26 @@ bool ComputeCompactLatticeAlphas(const CompactLattice &lat,
bool ComputeCompactLatticeBetas(const CompactLattice &lat,
vector *beta);

+static inline double LogAddOrMax(bool viterbi, double a, double b) {

do you still need this function to be in the header?


Reply to this email directly or view it on GitHub
https://github.com/kaldi-asr/kaldi/pull/560/files#r55153738.

Vimal Manohar
PhD Student
Electrical & Computer Engineering
Johns Hopkins University

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so you are going to call it from some other code you have written?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also if you are going to leave it in the header you should take away the 'static'.

@vimalmanohar
Copy link
Contributor Author

It seems there was only function that used it, which is not back in the .cc file. So I moved it to the .cc file.

return true;
}

static inline double LogAddOrMax(bool viterbi, double a, double b) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, you've now just moved this code around. could you revert this file?

@danpovey
Copy link
Contributor

danpovey commented Mar 7, 2016

and please squash your commits.

@vimalmanohar
Copy link
Contributor Author

Done

bool binary,
Vector<BaseFloat> *vec);

void RoundUpNumFrames(int32 frame_subsampling_factor,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should document this declaration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants